/**
* @file LocalPositionSimulator.cpp in SimulateLPS
* @author rebeater
* @comment Local Position System Simulator, Generate location data by uart
* Create on 3/22/22 10:58 PM
* @version 1.0
**/

#include <iostream>
#include <fmt/format.h>
#include "LocalPositionSimulator.h"
#include "glog/logging.h"
#include "LpsData.h"
int main() {
  google::InitGoogleLogging(".");
  google::LogToStderr();
  LOG(INFO) << fmt::format("frame size is {}",sizeof(LpsRaw));
  LocalPositionSimulator simulator;
  std::string file = "/media/rebeater/hd_data2/workspace/raw_data/2022/20200302/ADIs16465_01/ADI51_220302_272934.raw.gnsstxt";
  simulator.LoadFile(file);
  LOG(INFO) <<"Load finished";
  while(simulator.IsRunning()){
    if(!simulator.LpsOutput()){
      std::cout<<"Serial Error";
	  break;
    };
    std::this_thread::sleep_for(chrono::milliseconds (1000));
  }
  return 0;
}
